// store/indexedDB.ts
import { defineStore } from 'pinia'
import * as localForage from 'localforage'

export const useIndexedDBStore = defineStore('indexedDB', {
  state: () => ({
    filesDB: localForage.createInstance({
      name: 'filesDB'
    }),
    usersDB: localForage.createInstance({
      name: 'usersDB'
    }),
    responseDB: localForage.createInstance({
      name: 'responseDB'
    })
  }),
  actions: {
    async setfilesDB(key: string, value: any) {
      this.filesDB.setItem(key, value)
    }
  }
})
